<template>
  <div :style="{ height: `${height}px` }">
    <div class="card-cover text-center h-[100%]" v-if="!src">
      <a-image :src="getImageByFullPath('status/data.png')" :preview="false" :height="height" />
    </div>
    <div v-else class="flex flex-s h-[100%]">
      <a-image :src="src" :height="height" :preview="false" />
    </div>
  </div>
</template>

<script setup lang="ts">
import { getImageByFullPath } from '@/api/utils/image';
withDefaults(
  defineProps<{
    /* 标题封面 */
    src?: string;
    height?: number;
  }>(),
  {
    height: 80,
  },
);
</script>

<style lang="scss" scoped>
.card-cover {
  border-radius: var(--radius);
  display: flex;
  place-content: center;
  place-items: center;
  flex-direction: column;
  img {
    height: 100%;
    object-fit: cover;
  }
}
</style>
